﻿/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */


namespace Daidalos.Font
{
    internal sealed class BitmapCharacter : Interfaces.Cloneable<Daidalos.Font.BitmapCharacter>
    {

        #region Attributes
        private int x;
        private int y;
        private int width;
        private int height;
        private int xOffset;
        private int yOffset;
        private int xLeap;
        #endregion

        #region Properties
        public int XLeap
        {
            get
            {
                return xLeap;
            }
            set
            {
                xLeap = value;
            }
        }

        public int YOffset
        {
            get
            {
                return yOffset;
            }
            set
            {
                yOffset = value;
            }
        }

        public int XOffset
        {
            get
            {
                return xOffset;
            }
            set
            {
                xOffset = value;
            }
        }

        public int Height
        {
            get
            {
                return height;
            }
            set
            {
                height = (value > 0) ? value : 0;
            }
        }

        public int Width
        {
            get
            {
                return width;
            }
            set
            {
                width = (value > 0) ? value : 0;
            }
        }

        public int Y
        {
            get
            {
                return y;
            }
            set
            {
                y = value;
            }
        }

        public int X
        {
            get
            {
                return x;
            }
            set
            {
                x = value;
            }
        }
        #endregion

        public Daidalos.Font.BitmapCharacter Clone()
        {
            BitmapCharacter clone = new BitmapCharacter();
            clone.X = x;
            clone.Y = y;
            clone.Width = width;
            clone.Height = height;
            clone.XOffset = xOffset;
            clone.YOffset = yOffset;
            clone.XLeap = xLeap;
            return clone;
        }

    }
}
